<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stu_list</title>
</head>
<body>
<table border="1">
    <tr>
        <td>序号</td>
        <td>姓名</td>
        <td> 性别</td>
        <td>年级</td>
        <td>专业</td>
        <td>操作</td>
    </tr>
    {% for student in students %}

        <tr>
            <td>{{ student.id }}</td>
            <td>{{ student.stu_name }}</td>

            {% if student.sex == '1' or student.sex == '男' %}
                <td>男性</td>
            {% elif student.sex == '0' or student.sex == '女' %}
                <td>女性</td>
            {% else %}
                <td>未知</td>
            {% endif %}

            {#            <td>{{ student.sex }}</td>#}

            <td>{{ student.cls }}</td>
            <td>{{ student.subject }}</td>
            <td>
                <a href="{% url 'thinktank:stu_get' %}?id={{ student.id  }}">查看</a>
                <a href="{% url 'thinktank:stu_del' %}?id={{ student.id  }}">删除</a>
            </td>
        </tr>

    {% endfor %}
</table>
<th>
    {% if current_page > 1 %}
        <a href="{% url 'thinktank:stu_list' %}?page={{ current_page|add:-1 }}">上一页</a>
    {% endif %}
    &nbsp;&nbsp;当前页{{ current_page }}&nbsp;&nbsp;
{#    {% if current_page < max_page %}#}
    {% if has_next %}
        <a href="{% url 'thinktank:stu_list' %}?page={{ current_page|add:1 }}">下一页</a>
    {% endif %}
</th>
</body>
</html>